<template>
	<MyPage title="我的报价单" :isback="false">
		<view slot="right"><u-button type="error" size="mini" @click="$utils.navigateTo('/diy/quotation-add')">新增</u-button></view>
		<view slot="gBody">
			<view class="diy-box">
				<view
					class="diy-list"
					v-for="item in diyList"
					:key="index"
					@click="listClick(item)"
				>
					<view class="list-header">
						<view class="title">{{item.title}}</view>
						<view class="grey">{{item.count}}条</view>
					</view>
					<view class="margin-top10">时间：{{item.time}}</view>
					<view>分类：{{item.type}}</view>
				</view>
			</view>
		</view>
	</MyPage>
</template>		

<script>
import mixin from "@/libs/mixin.js";
export default {
	mixins: [mixin],
	data() {
		return {
			query: {
				page: 1,
				limit: 1000
			},
			diyList: [
				{title:'华为手机商品表',count:12,time:'2022-06-15',type:'通讯设备-手机'},
				{title:'联想电脑主机',count:147,time:'2022-08-21',type:'电脑-台式机'}
			]
		} 
	},
	onLoad() {
		//this.getData();
	}, 
	methods: {
		// 获取数据
		getData(){
			let arr = [];
			uni.request({
				url: 'http://www.txzh.com.cn/api.php?app=Default&act=getBill',  
				method: 'POST',
				header: {
					'Content-Type': 'application/x-www-form-urlencoded',
					'X-Requested-With': 'xmlhttprequest'
				},
				data:{
					page:this.query.page,
					type:this.query.type,
					token:this.$store.state.app.token
				},
				success: res => {
					this.diyList = res.data;
				},  
				fail: () => {},  
				complete: () => {}  
			});
		},
		// 列表点击查看详
		listClick(item){
			this.$utils.navigateTo('/diy/goods-list',{id:item.id});
		}
	}
}
</script>

<style lang="scss">
page{
	background:#f3f3f3;
}
</style>
<style lang="scss" scoped>
.diy-box{
	padding:20rpx 30rpx 30rpx;
	.diy-list{
		margin-bottom: 20rpx;
		padding: 28rpx 40rpx;
		background: #fff;
		border-radius: 10rpx;
		.list-header{
			display: flex;
			justify-content: space-between;
			.title{
				flex: 1;
				font-size: 32rpx;
			}
			.grey{
				white-space: nowrap;
				font-size:24rpx;
			}
		}
	}
}
.loadmore-box{
	padding:12rpx 0;
}
</style>